# $Id$
# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
# Maintainer: Roberto Carvajal <roberto@archlinux.org>

pkgname=mjpegtools
pkgver=2.1.0
pkgrel=3
pkgdesc="Set of tools that can do recording of videos and playback, simple cut-and-paste editing and the MPEG compression of audio and video"
arch=('i686' 'x86_64')
license=('GPL')
url="http://mjpeg.sourceforge.net/"
depends=('libjpeg' 'libpng' 'sdl' 'gcc-libs' 'libdv')
makedepends=('gtk2' 'v4l-utils')
optdepends=('gtk2: glav GUI')
options=('!makeflags')
source=(http://downloads.sourceforge.net/sourceforge/mjpeg/${pkgname}-${pkgver}.tar.gz)
md5sums=('57bf5dd78976ca9bac972a6511b236f3')

prepare() {
  cd ${pkgname}-${pkgver}
  sed -i -e '/ARCHFLAGS=/s:=.*:=:' configure
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr --enable-largefile
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -m644 mpeg2enc/mpeg2syntaxcodes.h "${pkgdir}/usr/include/mjpegtools/mpeg2enc/"
}
